package org.wisdom.cc.application.service;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import org.wisdom.cc.domain.repository.DictTypeRepository;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 启动类
 *
 * @author 张智研
 * @date 2022/06/14 20:55
 **/
@Slf4j
@Component
@RequiredArgsConstructor
public class CcServiceRunner implements ApplicationRunner {

    private final DictTypeRepository dictTypeRepository;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        this.dictTypeRepository.findCcDictTypeByDictType("");
//        String username = "admin";
//        boolean b =  userRepository.existsById(username);
//        if (!b) {
//            AcUser user = new AcUser();
//            user.setId(username);
//            user.setUsername(username);
//            user.setPassword(passwordEncoder.encode("123456"));
//            user.setEnabled(true);
//            userRepository.save(user);
//        }
    }
}
